
import javax.swing.*;
import javax.swing.border.LineBorder;

import java.awt.*;


public class RestaurantObject extends JPanel{
    
    String name = "asd ";
    String phone = "123";
    String opeaning = "7:30";
    
     public static void main(String[] args) 
    {
     JFrame frame = new JFrame();
     RestaurantObject main = new RestaurantObject();
     frame.add(main);
     frame.setTitle("my frame");
     frame.setSize(500,240);
     frame.setLocationRelativeTo(null);
     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     frame.setVisible(true);
    }
     
     public RestaurantObject(){
         JPanel p = new JPanel(new BorderLayout());
         JPanel p1 = new JPanel(new GridLayout(3, 1));
         
         p1.add(new JLabel(name));
         p1.add(new JLabel(phone));
         p1.add(new JLabel(opeaning));
         p.add(p1, BorderLayout.CENTER);
         p.add(new JLabel(new ImageIcon("image/Steak.png"  )), BorderLayout.WEST);
         
         setLayout(new BorderLayout());
         add(p, BorderLayout.WEST);
         
        this.setBorder(new LineBorder(Color.BLACK));
     }
    
}
